using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace Slqj.Data
{
	public static class TableUserReplies
	{
		public const string Table = "UserReplies";
		public const string UserRepliesID = "UserRepliesID";
		public const string UserGuestbookID = "UserGuestbookID";
		public const string Content = "Content";
		public const string Creater = "Creater";
		public const string CreatedBy = "CreatedBy";
		public const string Created = "Created";
		public const string Modified = "Modified";
		public const string ModifiedBy = "ModifiedBy";
		public const string ModifiedByID = "ModifiedByID";
		public const string RCreaterType = "RCreaterType";
	}
	
	[Serializable]
	public class BaseUserReplies
		: IDbSessionEntity, IJsonClass
	{
		int m_UserRepliesID;
		/// <summary>
        /// 消息回复表ID
        /// </summary>
        public int UserRepliesID
        {
            get { return m_UserRepliesID; }
            set { m_UserRepliesID = value; }
        }
		
		int? m_UserGuestbookID;
		/// <summary>
        /// 用户留言本ID
        /// </summary>
        public int? UserGuestbookID
        {
            get { return m_UserGuestbookID; }
            set { m_UserGuestbookID = value; }
        }
		
		string m_Content;
		/// <summary>
        /// 内容
        /// </summary>
        public string Content
        {
            get { return m_Content; }
            set { m_Content = value; }
        }
		
		int m_Creater;
		/// <summary>
        /// 创建人ID
        /// </summary>
        public int Creater
        {
            get { return m_Creater; }
            set { m_Creater = value; }
        }
		
		string m_CreatedBy;
		/// <summary>
        /// 创建人名称
        /// </summary>
        public string CreatedBy
        {
            get { return m_CreatedBy; }
            set { m_CreatedBy = value; }
        }
		
		DateTime m_Created;
		/// <summary>
        /// 创建时间
        /// </summary>
        public DateTime Created
        {
            get { return m_Created; }
            set { m_Created = value; }
        }
		
		DateTime m_Modified;
		/// <summary>
        /// 最后修改时间
        /// </summary>
        public DateTime Modified
        {
            get { return m_Modified; }
            set { m_Modified = value; }
        }
		
		string m_ModifiedBy;
		/// <summary>
        /// 修改人
        /// </summary>
        public string ModifiedBy
        {
            get { return m_ModifiedBy; }
            set { m_ModifiedBy = value; }
        }
		
		int? m_ModifiedByID;
		/// <summary>
        /// 修改人ID
        /// </summary>
        public int? ModifiedByID
        {
            get { return m_ModifiedByID; }
            set { m_ModifiedByID = value; }
        }
		
		int m_RCreaterType;
		/// <summary>
        /// 创建人对象（1：系统，2：酒店，3：景点,4:用户）
        /// </summary>
        public int RCreaterType
        {
            get { return m_RCreaterType; }
            set { m_RCreaterType = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_UserRepliesID = reader[TableUserReplies.UserRepliesID];
            m_UserGuestbookID = reader[TableUserReplies.UserGuestbookID];
            m_Content = reader[TableUserReplies.Content];
            m_Creater = reader[TableUserReplies.Creater];
            m_CreatedBy = reader[TableUserReplies.CreatedBy];
            m_Created = reader[TableUserReplies.Created];
            m_Modified = reader[TableUserReplies.Modified];
            m_ModifiedBy = reader[TableUserReplies.ModifiedBy];
            m_ModifiedByID = reader[TableUserReplies.ModifiedByID];
            m_RCreaterType = reader[TableUserReplies.RCreaterType];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
            writer.SetPrimaryKey(TableUserReplies.UserRepliesID, PrimaryKeyType.Identity, UserRepliesID);
			writer[TableUserReplies.UserGuestbookID] = UserGuestbookID;
			writer[TableUserReplies.Content] = Content;
			writer[TableUserReplies.Creater] = Creater;
			writer[TableUserReplies.CreatedBy] = CreatedBy;
			writer[TableUserReplies.Created] = Created;
			writer[TableUserReplies.Modified] = Modified;
			writer[TableUserReplies.ModifiedBy] = ModifiedBy;
			writer[TableUserReplies.ModifiedByID] = ModifiedByID;
			writer[TableUserReplies.RCreaterType] = RCreaterType;
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
            m_UserRepliesID = idd;
        }
		
		public string TableName
        {
            get { return TableUserReplies.Table; }
        }
		#endregion
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_UserRepliesID = hashToRead["UserRepliesID"];
			 
             m_UserGuestbookID = hashToRead["UserGuestbookID"];
			 
             m_Content = hashToRead["Content"];
			 
             m_Creater = hashToRead["Creater"];
			 
             m_CreatedBy = hashToRead["CreatedBy"];
			 
             m_Created = hashToRead["Created"];
			 
             m_Modified = hashToRead["Modified"];
			 
             m_ModifiedBy = hashToRead["ModifiedBy"];
			 
             m_ModifiedByID = hashToRead["ModifiedByID"];
			 
             m_RCreaterType = hashToRead["RCreaterType"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["UserRepliesID"] = UserRepliesID;
			 
            hashToFill["UserGuestbookID"] = UserGuestbookID;
			 
            hashToFill["Content"] = Content;
			 
            hashToFill["Creater"] = Creater;
			 
            hashToFill["CreatedBy"] = CreatedBy;
			 
            hashToFill["Created"] = Created;
			 
            hashToFill["Modified"] = Modified;
			 
            hashToFill["ModifiedBy"] = ModifiedBy;
			 
            hashToFill["ModifiedByID"] = ModifiedByID;
			 
            hashToFill["RCreaterType"] = RCreaterType;
			 
        }

        #endregion
		
	}
}
